home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / swab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  376 b   |  25 lines

  1. #include "lib.h"
  2.  
  3. /*  swab(3)
  4.  *
  5.  *  Author: Terrence W. Holm          Sep. 1988
  6.  */
  7.  
  8.  
  9. void swab( from, to, count )
  10. _VOIDSTAR from;
  11. _VOIDSTAR to;
  12. int     count;
  13. {
  14.   register unsigned char temp;
  15.  
  16.   count >>= 1;
  17.  
  18.   while( --count >= 0 )
  19.     {
  20.     temp  = *(unsigned char *)from++;
  21.     *(unsigned char *)to++ = *(unsigned char *)from++;
  22.     *(unsigned char *)to++ = temp;
  23.     }
  24.   }
  25.